Custom Comparable type {python} using __lt__
- links
- No value
- status
- No value
- aliases
- No value
- tags
- No value
- description
- No value
- title
- Custom Comparable type {python} using __lt__
- created
- 2023-08-14T20:32:45
- updated
- 2025-02-06T00:06:58
from abc import ABCMeta, abstractmethod
from typing import Any, TypeVar
class Comparable(metaclass=ABCMeta):
@abstractmethod
def __lt__(self, other: Any) -> bool: ...
CT = TypeVar('CT', bound=Comparable)